local skel = fk.CreateSkill({
    name = "sj5__jintao",
})
  
  Fk:loadTranslationTable{
    ["sj5__jintao"] = "进讨",
    [":sj5__jintao"] = "出牌阶段限两次，你可以将手牌数调整至与全场第X大/小相同，若没有则改为最小/最大。（X为你的手牌上限）",

    ["#sj5__jintao"] = "进讨：你可以将手牌数调整至与全场第X大/小相同，若没有则改为最小/最大（X为你的手牌上限）",

   ["$sj5__jintao1"] = "汝颈硬，比之金铁何如？",
   ["$sj5__jintao2"] = "魍魉鼠辈，速速系颈伏首！",
  }

  skel:addEffect("active", {
  prompt = "#sj5__jintao",
  interaction = function (self, player)
    local list,ask = {},{}
    for _, t in ipairs(Fk:currentRoom().alive_players) do
      table.insertIfNeed(list,t:getHandcardNum())
    end
    table.sort(list)
    local m = player:getMaxCards()
    local max = list[#list - m + 1] and list[#list - m + 1] or list[1]
    local min = list[m] and list[m] or list[#list]
    for _, n in ipairs({max,min}) do
      if n ~= player:getHandcardNum() then
        table.insertIfNeed(ask,tostring(n))
      end
    end
    return UI.ComboBox{choices = ask}
  end,
   can_use = function(self, player)
    return player:usedSkillTimes(skel.name,Player.HistoryPhase) < 2
   end,
   card_filter = function (self, player, to_select, selected)
    if self.interaction.data then
      local n = player:getHandcardNum() - tonumber(self.interaction.data)
      if n > 0 then
        return (#selected < n) and table.contains(player:getCardIds("h"),to_select) and not player:prohibitDiscard(to_select)
      end
      return false
    end

   end,
   target_filter = Util.FalseFunc,
   feasible = function (self, player, selected, selected_cards, card)
    if self.interaction.data then
      local n = player:getHandcardNum() - tonumber(self.interaction.data)
      if n > 0 then
        return #selected_cards == n
      end
      return true
    end

   end,
   on_use = function(self, room, effect)
    local player = effect.from
    if #effect.cards > 0 then
      room:throwCard(effect.cards,skel.name,player,player)
    else
      player:drawCards(tonumber(self.interaction.data) - player:getHandcardNum(),skel.name)
    end
   end,
  })

  return skel